package com.example.administrator.stargo.view;

import android.content.Context;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by Mloong on 2017/12/4.
 */

public class WebService {
    private String introud;
    private Context context;


    public static String getTime(String data){
        SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");

        return  sd.format(new Date(Long.parseLong(data)));
    }



   /* public WebService(Context context,String introud)  {
        super();
        this.context = context;
        this.introud = introud;
    }

    public void Webser(){
        if(introud!=null){

            System.out.println("...............222222222.");
            context.setScrollContainer(false);
            agent_account_webViewcon.setScrollbarFadingEnabled(false);
            agent_account_webViewcon.setVerticalScrollBarEnabled(false); //垂直不显示
            agent_account_webViewcon.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY);
            WebSettings settings = agent_account_webViewcon.getSettings();
            settings.setDefaultTextEncodingName("UTF-8");
            settings.setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);
            settings.setBuiltInZoomControls(false); // 设置显示缩放按钮
            settings.setSupportZoom(false); // 支持缩放
            System.out.println("................3333333333."+introud);
            StringBuffer str = new StringBuffer();
            str.append("<html><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /><body><p style=\"word-break:break-all; padding:12px;\">")
                    .append(introud)
                    .append("</p></body></html>")
                    .append("<style>\n" +
                            " \n" +
                            "img{\n" +
                            " width:100%;\n" +
                            " height:auto;\n" +
                            "}\n" +
                            " \n" +
                            "</style>");
            System.out.println("................44444444444444."+introud);
            agent_account_webViewcon.loadDataWithBaseURL("", str.toString(), "text/html","UTF-8", "");
        }else{

            System.out.println("................5555555555555."+introud);
            agent_account_webViewcon = (android.webkit.WebView) findViewById(R.id.agent_account_webViewcon);
            //WebView加载web资源
            agent_account_webViewcon.loadUrl("");
        }
    }*/


}
